home *** CD-ROM | disk | FTP | other *** search
- Path: news.mindlink.net!news
- From: genew@mindlink.bc.ca (Gene Wirchenko)
- Newsgroups: comp.arch.arithmetic,comp.lang.c,comp.lang.c++
- Subject: Re: Access carry flag from C
- Date: Mon, 26 Feb 1996 06:09:19 GMT
- Organization: MIND LINK! - British Columbia, Canada
- Message-ID: <4grivs$cp8@fountain.mindlink.net>
- References: <Dn1C9z.DGv.0.net@indra.com> <ARTHUR.96Feb20143404@gold.Smallworld.co.uk> <824853272snz@genesis.demon.co.uk> <4gqj0d$d6p@airdmhor.gen.nz>
- NNTP-Posting-Host: line070.nwm.mindlink.net
- X-Newsreader: Forte Free Agent 1.0.82
-
- gumboot@airdmhor.gen.nz (Simon Hosie) wrote:
-
- >Lawrence Kirby:
- >> It certainly can be done portably although not with the efficiency that
- >> a platform-specific solution is likely to give you.
-
- >> int j, k;
-
- >> ...
-
- >> if ((j >= 0) ? (k > INT_MAX-j) : (k < INT_MIN-j))
- > ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^
- > Won't they both be evaluated?
-
- No. Ref: K&R2, p 51. [slight change in presentation: no
- italics, etc.]
-
- "In the expression
-
- exptr1 ? expr2 : expr3
-
- the expression expr1 is evaluated first. ... Only one of expr2 and
- expr3 is evaluated."
-
- K&R2 is cheap and good. Buy a copy.
-
- Sincerely,
-
- Gene Wirchenko
-
- C Pronunciation Guide:
- y=x++; "wye equals ex plus plus semicolon"
- x=x++; "ex equals ex doublecross semicolon"
-
-